package demo7;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/2/28 17:44
 */
public class StringAndStringBuilderDemo {
    public static void main(String[] args) {
        String s = "a";
        for (int i = 0; i < 10000000; i++) {
            s = s + i;
        }
        System.out.println("执行完毕");
        StringBuilder builder = new StringBuilder("a");
        for (int i = 0; i < 10000000; i++) {
            builder.append("i");
        }
        System.out.println("执行完毕");

        String s1 = "a";
        for (int i = 0; i < 10000000; i++) {
            s1 = s1 + i;
        }
        System.out.println("执行完毕");
        StringBuilder builder1 = new StringBuilder("a");
        for (int i = 0; i < 10000000; i++) {
            builder1.append("i");
        }
        System.out.println("执行完毕");
    }
}
